<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
             width: 100px;
             height: 100px;
             /* transform:rotate(-30deg); 旋转 */
             background-color: red;
             margin: 50px ;
             /* transform: scale(.5); 缩放 */
             transform: translate(10px ,10px);
             transition: all 2s ease 2s;
        }
        div{
    width: 300px;
    height: 100px;
    background-color: pink;
    animation-name: test;
    animation-duration: 3s;
    animation-timing-function: ease;
    animation-delay: 0s;
    animation-iteration-count: infinite;
    animation-direction: normal;
    animation-play-state: running;
    animation-fill-mode: none;
}
/* 关于keyframes关键帧的内容稍后介绍     */
@keyframes test{
    0%{background-color: lightblue;}
    30%{background-color: lightgreen;}
    60%{background-color: red;}
    100%{background-color: black;}
}
    </style>
</head>
<body>
    
  <div class="box">

  </div>
    <script>
       
       var box=document.querySelector('.box')
       var num=0
       box.onclick=function(){

         num+=30  
         document.querySelector('.box').style.marginLeft=num+'px'
         
       }
       
     

    </script>
</body>
</html>